package com.aurora.app.util;

import com.aurora.app.enums.Level;

/**
 * 判断积分属于哪个等级
 * @author yongjiang.lin
 *
 */
public class WhichLevel {
	/**
	 * 获取等级
	 * @param huoyue 活跃分
	 * @param jiaoyi 交易分
	 * @return
	 */
	public static Level getLevel(float huoyue,float jiaoyi){
		if(jiaoyi == 0 && huoyue <= 10){
			return Level.YELLOW;
		}
		float total = jiaoyi + huoyue;
		
		if(total > 10 && total <= 100){
			return Level.RED;
		}
		
		if(total > 100 && total <= 300){
			return Level.BULE;
		}
		
		return Level.WHITE;
		
	}
}
